#ifndef COMBATPOWER_ADDON_H_
#define COMBATPOWER_ADDON_H_
#include "SimpleRefection.h"
#include "MgrBase.h"

struct BuffDef;
struct CombatPowerAddon:public ReflectionBase
{
	DECL_REFLECTION(CombatPowerAddon,"../../config/CombatPowerAddon.xml");
	int32 m_iID;
	std::string m_sDisplayName;
	int32 m_iPowerValue;
	std::vector<int32> m_vAddonBuffIDs;
	std::string m_sDesc;
	
	rewrite virtual void OnArchieveReaded();
	std::vector<const BuffDef*> m_vBuffs;
};
typedef DefMangerTpl<CombatPowerAddon> ___CombatPowerAddonManager;

class CombatPowerAddonManager :public  ___CombatPowerAddonManager
{
public:
	static CombatPowerAddonManager& Instance()
	{
		static CombatPowerAddonManager _instance;
		return _instance;
	}
	rewrite virtual void OnArchieveReaded();
	const std::vector<const CombatPowerAddon *>& SortedPowerAddons() const { return m_vSortedPowerAddons;}
	//const CombatPowerAddon * CheckNewAddonOnPowerChanged( int32 iOldPower,int32 iNewPower) const ;
	const CombatPowerAddon * GetCurrentAddon( int32 iCurrentPower) const ;
private:
	CombatPowerAddonManager(){}
	std::vector<const CombatPowerAddon *> m_vSortedPowerAddons;
};
#endif